from flask import Flask
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from config import Config

from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_mail import Mail
app = Flask(__name__) # 创建应用
app.config.from_object(Config)

db =SQLAlchemy(app) #数据库对象
migrate = Migrate(app,db) #迁移对象

login = LoginManager(app)
login.login_view ='login'

bootstrap = Bootstrap(app)
db.init_app(app)
mail =Mail()
app.config.update(
    MAIL_SERVER='smtp.qq.com',
    MAIL_PORT=465,
    MAIL_USE_SSL=True,
    MAIL_USERNAME='2338084901@qq.com',
    MAIL_PASSWORD='ombebsvuvnrpdjeg' )
mail.init_app(app)

from app import routes,models

